package com.srcptit.java.training.dungvv.btvn1;

import java.util.Scanner;

public class B1_M2_sapxep {
	public static void main(String [] args){
		int a[];
		int n;
		Scanner sc = new Scanner(System.in);
		System.out.println("nhap so phan tu cua day");
		n = sc.nextInt();
		a = new int[n];
		for(int i = 0; i < n; i++){
			System.out.print("Nhap a["+i+"]=");
			a[i] = sc.nextInt();
			System.out.println();
		}
		for(int i = 0; i < n - 1; i++)
			for(int j = i + 1; j < n; j++){
				if(a[i]>a[j]){
					int tmp = a[i]; a[i] = a[j]; a[j] = tmp;
				} 
			}
		System.out.println("Day sau khi day sap xep la");
		for(int i = 0; i < n; i++){
			System.out.print(a[i]+"  ");
			//System.out.println();
		}
	}
}
